const util = require('../../utils/util.js')
const data = require('../../utils/data.js')
const app = getApp();
Page({
    /**
     * 页面的初始数据
     */
    data: {
      log:"../../image/img/logo.png",
      movies: [
        '../../image/img/lb-0.png',      
        '../../image/img/lb-1.png',
      ],
      foodFresh: data.list_data,
      tabBar: {
        "color": "#ccc",
        "selectedColor": "#3ed9a5",
        "backgroundColor": "#3ed9a5",
        "borderStyle": "#ccc",
        "list": [
          {
            "pagePath": "../../pages/index/index",
            "text": "首页",
            "iconPath": "/image/icon/icon-index.png",
            "selectedIconPath": "/image/icon/icon-index.png",
            "active": false
          },
          {
            "pagePath": "../../pages/sort/sort",
            "text": "分类",
            "iconPath": "/image/icon/icon-sort.png",
            "selectedIconPath": "/image/icon/icon-sort.png",
            "selectedColor": "#4EDF80",
            "active": false
          },
          {
            "pagePath": "../../pages/shoppingCart/shoppingCart",
            "text": "购物车",
            "iconPath": "/image/icon/icon-sc.png",
            "selectedIconPath": "/image/icon/icon-sc.png",
            "selectedColor": "#4EDF80",
            "active": false
          },
          {
            "pagePath": "../../pages/my/my",
            "text": "我的",
            "iconPath": "/image/icon/icon-my.png",
            "selectedIconPath": "/image/icon/icon-my.png",
            "selectedColor": "#4EDF80",
            "active": false
          }
        ],
        "position": "bottom"
      }
    },

    /**
     * 生命周期函数--监听页面加载
     */
  onLoad: function () {
      app.editTabBar(this);
  },
  btnExpertList: function (e) { //更多
    console.log(e);
    console.log(e.currentTarget.id)
  },
  btnSearch:function(){ //跳转搜索页面
    wx.navigateTo({
      url: "../search/search"
    });
  },
  btnDetails(e){       //跳转商品详情页
    wx.navigateTo({
      url: "../details/details?uid=" + e.currentTarget.id
    });
  },
  onReady: function () {
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})
